package com.sixth.docker.controller;

import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.A;
import com.sixth.core.entity.CareOrder;
import com.sixth.core.entity.CareOrderItem;
import com.sixth.core.vo.R;
import com.sixth.docker.service.CareOrderService;
import com.sixth.docker.vo.CareOrderVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @program: sixth-hospital-parent
 * @description:
 * @author: 赵庆龙
 * @create: 2024-08-19 18:34
 **/
@RestController
@RequestMapping("/doctor/careOrder")
public class CareOrderController {
    @Autowired
    private CareOrderService careOrderService;
    @GetMapping("/CareOrdersByChId/{chId}")
    public R<List<CareOrder>> CareOrdersByChId(@PathVariable String chId)
    {
        return careOrderService.selectBychId(chId);
    }
    @PostMapping("/saveCareOrderItem")
    public R<CareOrder> saveCareOrderItem(@RequestBody CareOrderVO careOrderVO)
    {
        return careOrderService.saveCareOrderItem(careOrderVO);
    }

    @PostMapping("/selectByPatientId/{patientId}")
    public R<List<CareOrder>> selectByPatientId(@PathVariable String patientId){
        return careOrderService.selectByPatientId(patientId);
    }
    @DeleteMapping("/deleteById/{coId}")
    public R<CareOrder> deleteById(@PathVariable String coId)
    {
        return careOrderService.deleteById(coId);
    }
}
